{extend name="$BASE_POPUP_FORM" /}
{block name="body"}
<div id="js_tab" class="tab-panel">
    <ul class="tab-header">
        <li class="tab-item current" data-tag="0">基础信息</li>
    </ul>
    <div class="tab-content">
        <div id="js_div0" class="html-content" >
            <input type="hidden" id="id" name="id" value="{$id}"/>
            <input type="hidden" id="news_json" name="news_json" />
            <div class="control-row col-2">
                <div class="control-group">
                    <label class="control-label">充值地址</label>
                    <div class="controls">
                        <input type="text" style="width:300px" id="address" name="address" placeholder="输入充值地址" class="form-control required" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">内容</label>
                    <div class="controls">
                        <textarea name="content" id="content" rows="5" cols="40"></textarea>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                        二维码
                    </label>
                    <div class="controls">
                        <div id="js_upload_wrp">
                            <input type="hidden" id="images" name="images" value="" class="" />
                            {:hook('picResource',array('name'=>'images','limit_num'=> '5','checktype'=>1,'folder'=>'top_up','tips'=>'建议尺寸：800x600像素。仅支持.jpg .png格式长方形照片。','callback'=>'uploadImg'))}
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                        背景图
                    </label>
                    <div class="controls">
                        <div>
                            <input type="hidden" id="background_img" name="background_img" value="" class="" />
                            {:hook('picResource',array('name'=>'background_img','limit_num'=> '1','checktype'=>1,'folder'=>'top_up','tips'=>'建议尺寸：800x600像素。仅支持.jpg .png格式长方形照片。','callback'=>'uploadImgBack'))}
                        </div>
                    </div>
                </div>

            </div>
        </div>

    </div>
</div>


{/block}
{block name="script"}
<script type="text/javascript">
    /**
     * 点击图片删除
     * */
    $('#js_upload_wrp').on("click", ".js_delete", function (e) {
        var _this = $(this);
        _this.parents(".js_edit_pic_wrp").remove();
        setPicValue()
    });
    /**
     * 添加图片
     */
    function uploadImg(data) {
        $("#images").val(data);
        setPicValue("images",data);
    }
    function uploadImgBack(data) {
        $("#background_img").val(data);
        setPicValue("background_img",data);
    }
    function onLoadDataSuccess(data) {
        if (typeof (onLoadSuccess) !== "undefined")
            onLoadSuccess();
        setPicValue("images", data['images']);
        setPicValue("background_img", data['background_img']);
    }
</script>
{/block}


